package com.syty.demo.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.sql.Date;

@ApiModel(description = "用户登录的实体")
@EqualsAndHashCode
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_user")
public class User {
    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    @ApiModelProperty(value = "用户名")
    private String username;
    @ApiModelProperty(value = "密码")
    private String password;
    @ApiModelProperty(value = "盐")
    private String salt;
    @ApiModelProperty(value = "角色")
    private String role;
    @ApiModelProperty(value = "创建时间，由handler进行插入创建")
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    public User(String username, String password, String salt, String status) {
        this.username = username;
        this.password = password;
        this.salt = salt;
        this.role = status;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }
}

